package com.dashu.base.enums;


import java.util.HashMap;
import java.util.Map;

public enum ReplRyCode {


    SUCCESS(100000, "账户添加"),
    DATA_NOT_NULL(100001, "数据不能未空"),
    DATA_IDORPAS(100002, "账号或密码错误"),
    EXIST_USER(100003, "用户已存在"),
    USER_NOT_DATA(100004, "无用户信息"),
    USER_ORIGINAL_NULL(100005, "原密码不能为空"),
    USER_ORIGINAL_PASS(100006, "原密码不正确"),
    PERMISSION_NOT_DATA(100007, "无权限信息"),
    COMPANY_NOT_DATA(100008, "无部门信息"),
    HEDERS_TOKEN(100008, "token失效！"),
    HEDERS_DATA(100009, "data为null"),
    DATA_ERROR(100010, "数据格式错误！"),
    DATA_NOT_INVALID(100011, "格式有误！"),
    EXIST_PERMISSION(1000012, "角色已存在"),
    EXIST_COMPANY(1000013, "单位已存在"),
    EXIST_COMPANY_DEPARTMENT(1000014, "单位已存在"),
    COMPANY_DEPARTMENT_NOT_DATA(1000015, "无组织信息"),
    COMPANY_PARENT_NOT_DATA(1000016, "无家长信息"),
    EXIST_PHONE(1000017, "号码以使用"),
    DATA_NOT_IMG(1000018, "无图片信息"),
    EXIST_RELATIONSHIP(1000019, "关系已存在"),
    USER_IDENTITY_EXPIRED(1000020, "身份以过期"),
    COMPANY_TEACHER_NOT_DATA(1000021, "无教师信息"),
    RELATION_NOT(1000022, "关联不存在"),
    BATCH_REMOV_ERROR(1000023, "批次删除失败"),
    EXIST_COMPANY_PERSONAL_CLS(1000024, "所在班级学号不能重复"),
    COMPANY_PERSONAL_NOT_DATA(1000025, "无个人信息"),
    ERROR_PHONE(1000026, "号码格式错误"),
    ATTENDANCE_RULE_TIME(1000027, "已有考勤组规则使用"),
    ATTENDANCE_NOT_TIME(1000028, "无时间规则"),
    LEVEL_ERROR(1000029, "节点创建失败"),
    EXIST_DEVICE_UUID(1000030, "uuid已存在"),
    EXIST_DEVICE_NAME(1000031, "设备名称已存在"),
    EXIST_DEVICE_TYPEID(1000032, "通道或进出类型重复"),
    EXIST_PERMISSION_USER(1000033, "已存在绑定账号"),
    EXIST_GL_DEPARTMENT(1000034, "已存在年级关联"),
    EXIST_GL_CLS(1000034, "已存在班级关联"),
    EXIST_GL_PERSONAL(1000035, "已存在班级学生"),
    CLS_FULL(1000036, "以达班级人数上限"),
    EXIST_COMPANY_NUM(1000037, "学校编号已存在"),
    DISABLE(1000038, "账号权限已关闭"),
    EXIST_ClS_TEACHER_IDEA(1000039, "班主任已存在"),
    EXIST_BIND_DEVICE(1000040, "未绑定设备"),
    BIND_PARENT_PERSONAL(1000041, "学生与家长不在同所学校"),
    BIND_PARENT_FULL(1000042, "家长关联以达标"),
    BIND_PERSONAL_FULL(1000043, "学生关联以达标"),
    BIND_NOT_PERSONAL(1000044, "无学生信息"),
    EXIST_NAME(100045, "名称已存在"),
    EXIST_COMPANY_ADDRESS(1000046, "学校地址已存在");


    /**
     * 提示码
     */
    private int code;

    /**
     * 描述
     */
    private String message;

    ReplRyCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }


    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;

    }

    public void setCode(int code) {
        this.code = code;
    }

    private static final Map<Integer, ReplRyCode> MAP = new HashMap<>();

    static {

        for (ReplRyCode season : values()) {
            MAP.put(season.code, season);
        }
    }

    public static ReplRyCode valueOfName(int code) {
        return MAP.get(code);
    }

}


